/*
 * 异步加载组件
 * */
'use stirct'
/*路由*/
const home = r => require.ensure([], () => r(require('./views/home/index')), 'home');
const layoutCom = r => require.ensure([], () => r(require('./components/layoutCom')), 'layoutCom');
const Apage = r => require.ensure([], () => r(require('./views/public/Apage')), 'Apage');
const Ppage = r => require.ensure([], () => r(require('./views/public/Ppage')), 'Ppage');
const Cpage = r => require.ensure([], () => r(require('./views/public/Cpage')), 'Cpage');
const introduce = r => require.ensure([], () => r(require('./components/introduce')), 'introduce');

const allad = r => require.ensure([], () => r(require('./views/about/allad')), 'allad');
const news = r => require.ensure([], () => r(require('./views/news/news')), 'news');

const zhuanke = r => require.ensure([], () => r(require('./views/zhuanke/index')), 'zhuanke');
const team = r => require.ensure([], () => r(require('./views/zhuanke/team')), 'team');
const hospitalTeam = r => require.ensure([], () => r(require('./views/zhuanke/hospitalTeam')), 'hospitalTeam');

export default [
  {
    path: '/home',
    name: 'home',
    component: layoutCom,
    redirect:'home/index',
    children: [
      {
        path: 'index',
        component: home,
        meta:{
          name:'index'
        }
      }
    ]
  },
  {
    path: '/about',
    name: 'about',
    component: layoutCom,
    redirect: 'about/allad/aboutUs',
    children: [
      {
        path: 'allad', //默认类型
        name: 'about/allad',
        component: allad
      },
      {
        path: 'allad/:type',
        name: 'about/allad',
        component: allad
      },
      {
        path: 'a/:type',
        name: 'about/allad',
        component: allad
      }
    ]
  },
  {
    path: '/news',
    name: 'news',
    component: layoutCom,
    redirect: 'news/allad',
    children: [
      {
        path: ':type',
        name: 'news',
        component: news
      },
      {
        path: ':type/:articleId',
        name: 'news',
        component: news
      }
    ]
  },
  {
    path: '/zhuanke',
    name: 'zhuanke',
    component: layoutCom,
    redirect: 'zhuanke/index',
    children: [
      {
        path: 'index',
        component: zhuanke
      },
      {
        path: ':code',
        component: zhuanke
      },
      {
        path: ':code/:type',
        component: zhuanke
      },
      {
        path: ':code/:type/:doctorId',
        component: zhuanke
      },

      {
        path: 'Apage',//治疗中心,领先设备，手术种类说明
        component: Apage
      },
      {
        path: 'team',
        component: team
      },
      {
        path: 'Cpage',//成功案例，常见问题
        component: Cpage
      },
      {
        path: 'hospitalTeam',//医院专家团队
        component: hospitalTeam
      },
    ]
  },
  {
    path: '/team',
    name: 'team',
    component: layoutCom,
    redirect: 'team/index',
    children: [
      {
        path: 'index',
        component: hospitalTeam
      },
      {
        path: 'introduce',
        component: introduce
      },
    ]
  },
  {
    path: '*',
    redirect: '/home'
  },
]

